package com.nineclock.approve.resolver.impl;

import cn.hutool.json.JSONObject;
import com.nineclock.approve.resolver.ProcessNodeResolver;
import org.activiti.bpmn.model.Process;
import org.activiti.bpmn.model.UserTask;

/**
 * 抄送节点解析处理器
 */
public class CCListNodeResolver  extends ProcessNodeResolver {
    @Override
    public void addFlowNodeToActiviti(Process process, JSONObject currNode, JSONObject nextNode) {

        //创建抄送节点
        UserTask userTask = new UserTask();
        userTask.setId(getNodeId(currNode));
        userTask.setName(currNode.getStr("name"));
        userTask.setCategory("2");// 抄送, 知会

        process.addFlowElement(userTask);

        //绘制连线
        newSequenceFlow(process, currNode, nextNode, null);
    }
}